FROM jdk-mysql-xtrabackup:base

RUN yum install kde-l10n-Chinese -y  && yum install glibc-common -y && yum install python3 -y && yum install python3-devel -y && yum install -y bind bind-libs bind-utils bind-chroot expect
RUN localedef -c -f UTF-8 -i zh_CN zh_CN.utf8
RUN export LANG=zh_CN.UTF-8
RUN echo "export LANG=zh_CN.UTF-8" >> /etc/locale.conf
ENV LANG zh_CN.UTF-8
ENV LC_ALL zh_CN.UTF-8

RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

RUN mkdir -p /mesh-monitor

RUN mkdir -p /conf

WORKDIR /mesh-monitor

ADD ./gmssl-gcloud/gmssl /usr/lib64/python3.6/site-packages/gmssl
ADD ./gmssl-gcloud/gmssl-3.2.1-py3.6.egg-info /usr/lib64/python3.6/site-packages/gmssl-3.2.1-py3.6.egg-info
ADD ./gmssl-gcloud/smXtool /mesh-monitor/
RUN chmod a+x ./smXtool && cp ./smXtool /usr/local/bin

ADD ./cacerts /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.272.b10-1.el7_9.x86_64/jre/lib/security/cacerts
ADD ./target/classes/application.yml /mesh-migrate/config
ADD ./target/mesh-monitor-1.0.0.jar ./

EXPOSE 16016
EXPOSE 5051

CMD sleep 3;java -Djava.security.egd=file:/dev/./urandom -Dspring.profiles.active=docker -jar -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5051 mesh-monitor-1.0.0.jar
